<script>
//基本折线图配置
import BaseConfig from '../BaseConfig';
import * as ConfigEnum from '../config/config-enum';

export default {
  name: 'LineConfig',
  mixins: [BaseConfig],
  data() {
    return {
      lineTypes: ConfigEnum.LINE_STYLE_TYPE,
    };
  },
};
</script>

<template>
  <div>
    <Row>
      <Col span="8">
      <span>线宽：</span>
      </Col>
      <Col span="16">
      <InputNumber
        v-model="chartOptions.settings.lineStyle.normal.width"
        :min="1"
        @on-change="updateOptions"></InputNumber>
      </Col>
    </Row>
    <Row>
      <Col span="8">
      <span>线型：</span>
      </Col>
      <Col span="16">
      <Select
        v-model="chartOptions.settings.lineStyle.normal.type"
        @on-change="updateOptions">
        <Option
          v-for="item in lineTypes"
          :value="item.value"
          :key="item.value">{{ item.key }}</Option>
      </Select>
      </Col>
    </Row>
    <Row>
      <Col span="8">
      <span>近似曲线：</span>
      </Col>
      <Col span="16">
      <Switch
        v-model="chartOptions.extend.series[0].smooth"
        @on-change="updateSeriesAndOptions('smooth')">
        <span slot="open">是</span>
        <span slot="close">否</span>
      </Switch>
      </Col>
    </Row>
    <Row>
      <Col span="8">
      <span>线透明度：</span>
      </Col>
      <Col span="16">
      <Slider
        v-model="chartOptions.settings.lineStyle.normal.opacity"
        :step="0.1"
        :min="0"
        :max="1"
        show-stops
        @on-change="updateOptions"></Slider>
      </Col>
    </Row>
  </div>
</template>

<style>
</style>
